.category-manage-page {
  min-height: 100vh;
  background: #f5f6fa;
  display: flex;
  flex-direction: column;

  .custom-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 1000;
    box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.05);

    .nav-content {
      display: flex;
      align-items: center;
      height: 88rpx;
      padding: 0 28rpx;
    }

    .nav-back,
    .nav-placeholder {
      width: 88rpx;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .back-icon {
      width: 40rpx;
      height: 40rpx;
    }

    .nav-title {
      flex: 1;
      text-align: center;
      font-size: 34rpx;
      font-weight: 600;
      color: #333;
    }
  }

  .content {
    flex: 1;
    height: 100vh;
    padding: 24rpx;
    box-sizing: border-box;
  }

  .page-tip {
    background: #fff;
    border-radius: 24rpx;
    padding: 28rpx 32rpx;
    margin-bottom: 24rpx;
    box-shadow: 0 12rpx 24rpx rgba(93, 99, 112, 0.08);

    .tip-title {
      display: block;
      font-size: 30rpx;
      font-weight: 600;
      color: #333;
      margin-bottom: 8rpx;
    }

    .tip-text {
      font-size: 26rpx;
      color: #666;
    }
  }

  .loading-state {
    text-align: center;
    padding: 120rpx 0;
    color: #999;
    font-size: 28rpx;
  }

  .empty-state {
    background: #fff;
    border-radius: 24rpx;
    padding: 68rpx 40rpx;
    text-align: center;
    margin-bottom: 24rpx;
    box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.06);

    image {
      width: 200rpx;
      margin-bottom: 24rpx;
    }

    .title {
      font-size: 34rpx;
      font-weight: 600;
      color: #333;
    }

    .desc {
      display: block;
      font-size: 26rpx;
      color: #999;
      margin: 16rpx 0 32rpx;
    }

    .add-btn {
      border: none;
      background: #5cb85c;
      color: #fff;
      padding: 20rpx 40rpx;
      border-radius: 40rpx;
      font-size: 28rpx;

      &::after {
        border: none;
      }
    }
  }

  .category-item {
    background: #fff;
    border-radius: 24rpx;
    padding: 28rpx 30rpx;
    margin-bottom: 24rpx;
    box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.05);

    &.primary-category {
      border-left: 6rpx solid #5cb85c;
    }

    &.secondary-category {
      margin-left: 40rpx;
      margin-top: 16rpx;
      border-left: 4rpx solid #9ed29e;
      background: #fafbfc;
    }
  }

  .category-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .category-content {
    flex: 1;

    .category-label {
      display: inline-block;
      font-size: 22rpx;
      color: #999;
      background: #f5f5f5;
      padding: 4rpx 12rpx;
      border-radius: 8rpx;
      margin-right: 12rpx;
    }

    .category-name {
      font-size: 32rpx;
      color: #333;
      font-weight: 600;
    }

    .category-meta {
      display: block;
      font-size: 24rpx;
      color: #999;
      margin-top: 8rpx;
      margin-left: 88rpx; // 对齐到分类名称下方
    }
  }

  .category-actions-inline {
    display: flex;
    gap: 20rpx;
    align-items: center;

    .action-btn {
      font-size: 26rpx;
      color: #5cb85c;
      padding: 8rpx 16rpx;
      border-radius: 8rpx;
      background: #f0f9f4;
      
      &.danger {
        color: #ff6b6b;
        background: #fff5f5;
      }
    }
  }

  .secondary-categories {
    margin-top: 20rpx;
    padding-top: 20rpx;
    border-top: 1rpx dashed #e8e8e8;
  }

  .add-secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8rpx;
    margin-top: 16rpx;
    padding: 16rpx;
    border-radius: 12rpx;
    border: 2rpx dashed #d0d0d0;
    color: #999;
    font-size: 26rpx;
    background: #fafafa;

    .add-icon {
      font-size: 32rpx;
      color: #5cb85c;
    }
  }

  .add-primary {
    width: 100%;
    margin: 20rpx 0 140rpx;
    height: 90rpx;
    border-radius: 45rpx;
    border: 2rpx dashed #5cb85c;
    color: #5cb85c;
    background: rgba(92, 184, 92, 0.05);
    font-size: 28rpx;
    text-align: center;
    line-height: 90rpx;

    &::after {
      border: none;
    }
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99;
  padding: 40rpx;
  box-sizing: border-box;
}

.modal-content {
  width: 100%;
  background: #fff;
  border-radius: 24rpx;
  padding: 32rpx;
  box-sizing: border-box;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24rpx;

  text {
    font-size: 32rpx;
    font-weight: 600;
    color: #333;
  }

  .modal-close {
    font-size: 40rpx;
    color: #999;
  }
}

.modal-body {
  .form-item {
    margin-bottom: 24rpx;

    .label {
      display: block;
      font-size: 26rpx;
      color: #666;
      margin-bottom: 12rpx;
    }

    .input {
      width: 100%;
      padding: 18rpx 24rpx;
      border-radius: 16rpx;
      background: #f8f9fb;
      border: 1rpx solid transparent;
      font-size: 28rpx;
      color: #333;

      &:focus {
        border-color: #5cb85c;
      }
    }
  }

  .switch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10rpx 0;

    .label {
      margin-bottom: 0;
    }
  }
}

.modal-footer {
  display: flex;
  gap: 20rpx;
  margin-top: 12rpx;

  .btn {
    flex: 1;
    height: 88rpx;
    border-radius: 44rpx;
    border: none;
    font-size: 30rpx;

    &::after {
      border: none;
    }

    &.ghost {
      background: #f1f3f8;
      color: #5b6477;
    }

    &.primary {
      background: linear-gradient(135deg, #5cb85c, #41a046);
      color: #fff;
    }
  }
}


